<?php
/* SVN FILE: $Id: furlTemplates.php 224 2009-09-17 19:25:18Z supersmashbrothers $ */
/**
* ibMarket 2
* IP.Board 3.0
* ibMarket Friendly Urls Templates
*
* @author $Author: supersmashbrothers $
* @copyright $Copyright$
* @version $Revision: 224 $
* @lastrevision $Date: 2009-09-17 19:25:18 +0000 (Thu, 17 Sep 2009) $
* @modifiedby $LastChangedBy: supersmashbrothers $
* @lastmodified $LastChangedDate: 2009-09-17 19:25:18 +0000 (Thu, 17 Sep 2009) $
* @filesource $URL: http://ipb-ibmarket.googlecode.com/svn/ibmarket2/trunk/admin/applications_addon/other/ibmarket/extensions/furlTemplates.php $
*/

if ( ! defined( 'IN_IPB' ) )
{
	print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
	exit();
}

/**
 * SEO templates
 *
 * 'allowRedirect' is a flag to tell IP.Board whether to check the incoming link and if not formatted correctly, redirect the correct one
 *
 * OUT FORMAT REGEX:
 * First array element is a regex to run to see if we've a match for the URL
 * The second array element is the template to use the results of the parenthesis capture
 *
 * Special variable #{__title__} is replaced with the $title data passed to output->formatUrl( $url, $title)
 *
 * IMPORTANT: Remember that when these regex are used, the output has not been fully parsed so you will get:
 * showuser={$data['member_id']} NOT showuser=1 so do not try and match numerics only!
 *
 * IN FORMAT REGEX
 *
 * This allows the registry to piece back together a URL based on the template regex
 * So, for example: "/user/(\d+?)/", 'matches' => array(  array( 'showuser' => '$1' ) )tells IP.Board to populate 'showuser' with the result
 * of the parenthesis capture #1
 */
$_SEOTEMPLATES = array(
	'ibmarketShopAll'     => array(	'app'			=> 'ibmarket',
									'allowRedirect'	=> 1,
									'out'			=> array(	'#app=ibmarket(&amp;|&)module=shop((&amp;|&)category=\-1|)(&|$)#i', 'ibmarket/shop-all/$4' ),
							  		'in'			=> array(	'regex'   => "#/ibmarket/shop-all#i",
																'matches' => array( array( 'app', 'ibmarket' ), array( 'module', 'shop' ), array( 'category', '$1' ) ) ) ),
	'ibmarketShop'     => array(	'app'			=> 'ibmarket',
									'allowRedirect'	=> 1,
									'out'			=> array(	'#app=ibmarket(&amp;|&)module=shop(&amp;|&)category=(\d+?)(&|$)#i', 'ibmarket/shop-$3-#{__title__}/$4' ),
							  		'in'			=> array(	'regex'   => "#/ibmarket/shop-(\d+?)-#i",
																'matches' => array( array( 'app', 'ibmarket' ), array( 'module', 'shop' ), array( 'category', '$1' ) ) ) ),
	'ibmarketInventory'     => array(	'app'			=> 'ibmarket',
										'allowRedirect'	=> 1,
										'out'			=> array(	'#app=ibmarket(&amp;|&)module=inventory(&|$)#i', 'ibmarket/inventory/$2' ),
										'in'			=> array(	'regex'   => "#/ibmarket/inventory/#i",
																	'matches' => array( array( 'app', 'ibmarket' ), array( 'module', 'inventory' ) ) ) ),
	'ibmarketPlugin'     => array(	'app'			=> 'ibmarket',
									'allowRedirect'	=> 1,
									'out'			=> array(	'#app=ibmarket((&amp;|&)module=plugin|)(&amp;|&)plugin=(.+?)(&|$)#i', 'ibmarket/plugin-$4-#{__title__}/$5' ),
									'in'			=> array(	'regex'   => "#/ibmarket/plugin-(.+?)-#i",
																'matches' => array( array( 'app', 'ibmarket' ), array( 'plugin', '$1' ) ) ) ),
	'app=ibmarket'     => array(	'app'			=> 'ibmarket',
									'allowRedirect'	=> 1,
									'out'			=> array(	'#app=ibmarket#i', 'ibmarket/' ),
							  		'in'			=> array(	'regex'   => "#/ibmarket/?$#i",
																'matches' => array( array( 'app', 'ibmarket' ) ) ) ),
);
